<?php

abstract class Core_controller_abstract
{
	protected $view;
	protected $requstMethod;
	
	public function __construct($moduleName, $actionName)
	{
		if(empty($moduleName) || empty($actionName))
		{
			exit('Error');
		}
		$this->view = new Core_view(null);
		$this->view->moduleName = $moduleName;
		$this->view->actionName = $actionName;
		
		if(method_exists($this, '_init'))
		{
			$this->_init();
		}
		
		$this->requstMethod = $_SERVER['REQUEST_METHOD'];
	}
	
	protected function _redirect($url, $time = 0)
	{
		if(0 === $time) 
		{
            //header("Location: ".$url);
        }
        else 
        {
            //header("refresh:{$time};url={$url}");
        }
        exit();
	}
}